# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.NetworkManagement.V1beta1.Model.ConnectivityTest do
  @moduledoc """
  A Connectivity Test for a network reachability analysis.

  ## Attributes

  *   `bypassFirewallChecks` (*type:* `boolean()`, *default:* `nil`) - Whether the analysis should skip firewall checking. Default value is false.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the test was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - The user-supplied description of the Connectivity Test. Maximum of 512 characters.
  *   `destination` (*type:* `GoogleApi.NetworkManagement.V1beta1.Model.Endpoint.t`, *default:* `nil`) - Required. Destination specification of the Connectivity Test. You can use a combination of destination IP address, URI of a supported endpoint, project ID, or VPC network to identify the destination location. Reachability analysis proceeds even if the destination location is ambiguous. However, the test result might include endpoints or use a destination that you don't intend to test.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Output only. The display name of a Connectivity Test.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Resource labels to represent user-provided metadata.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Unique name of the resource using the form: `projects/{project_id}/locations/global/connectivityTests/{test}`
  *   `probingDetails` (*type:* `GoogleApi.NetworkManagement.V1beta1.Model.ProbingDetails.t`, *default:* `nil`) - Output only. The probing details of this test from the latest run, present for applicable tests only. The details are updated when creating a new test, updating an existing test, or triggering a one-time rerun of an existing test.
  *   `protocol` (*type:* `String.t`, *default:* `nil`) - IP Protocol of the test. When not provided, "TCP" is assumed.
  *   `reachabilityDetails` (*type:* `GoogleApi.NetworkManagement.V1beta1.Model.ReachabilityDetails.t`, *default:* `nil`) - Output only. The reachability details of this test from the latest run. The details are updated when creating a new test, updating an existing test, or triggering a one-time rerun of an existing test.
  *   `relatedProjects` (*type:* `list(String.t)`, *default:* `nil`) - Other projects that may be relevant for reachability analysis. This is applicable to scenarios where a test can cross project boundaries.
  *   `returnReachabilityDetails` (*type:* `GoogleApi.NetworkManagement.V1beta1.Model.ReachabilityDetails.t`, *default:* `nil`) - Output only. The reachability details of this test from the latest run for the return path. The details are updated when creating a new test, updating an existing test, or triggering a one-time rerun of an existing test.
  *   `roundTrip` (*type:* `boolean()`, *default:* `nil`) - Whether run analysis for the return path from destination to source. Default value is false.
  *   `source` (*type:* `GoogleApi.NetworkManagement.V1beta1.Model.Endpoint.t`, *default:* `nil`) - Required. Source specification of the Connectivity Test. You can use a combination of source IP address, URI of a supported endpoint, project ID, or VPC network to identify the source location. Reachability analysis might proceed even if the source location is ambiguous. However, the test result might include endpoints or use a source that you don't intend to test.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time the test's configuration was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bypassFirewallChecks => boolean() | nil,
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :destination => GoogleApi.NetworkManagement.V1beta1.Model.Endpoint.t() | nil,
          :displayName => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :probingDetails => GoogleApi.NetworkManagement.V1beta1.Model.ProbingDetails.t() | nil,
          :protocol => String.t() | nil,
          :reachabilityDetails =>
            GoogleApi.NetworkManagement.V1beta1.Model.ReachabilityDetails.t() | nil,
          :relatedProjects => list(String.t()) | nil,
          :returnReachabilityDetails =>
            GoogleApi.NetworkManagement.V1beta1.Model.ReachabilityDetails.t() | nil,
          :roundTrip => boolean() | nil,
          :source => GoogleApi.NetworkManagement.V1beta1.Model.Endpoint.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:bypassFirewallChecks)
  field(:createTime, as: DateTime)
  field(:description)
  field(:destination, as: GoogleApi.NetworkManagement.V1beta1.Model.Endpoint)
  field(:displayName)
  field(:labels, type: :map)
  field(:name)
  field(:probingDetails, as: GoogleApi.NetworkManagement.V1beta1.Model.ProbingDetails)
  field(:protocol)
  field(:reachabilityDetails, as: GoogleApi.NetworkManagement.V1beta1.Model.ReachabilityDetails)
  field(:relatedProjects, type: :list)

  field(:returnReachabilityDetails,
    as: GoogleApi.NetworkManagement.V1beta1.Model.ReachabilityDetails
  )

  field(:roundTrip)
  field(:source, as: GoogleApi.NetworkManagement.V1beta1.Model.Endpoint)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.NetworkManagement.V1beta1.Model.ConnectivityTest do
  def decode(value, options) do
    GoogleApi.NetworkManagement.V1beta1.Model.ConnectivityTest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.NetworkManagement.V1beta1.Model.ConnectivityTest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
